package com.wicket.okrbff.web.contorller;

import com.wicket.okrbff.biz.service.RoleService;
import com.wicket.okrbff.biz.service.dto.req.*;
import com.wicket.okrbff.biz.service.dto.res.*;
import com.wicket.okrbff.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.wicket.okrframework.integration.FwBaseRoleClient;
import com.wicket.okrframework.integration.dto.UpdateCustomRoleRespDto;
import com.wicket.okrframework.integration.dto.UpdateCustomRoleReqDto;
import com.wicket.okrframework.integration.FwBaseMemberClient;
import com.wicket.okrframework.integration.dto.QueryRoleRelListRespDto;
import com.wicket.okrframework.integration.dto.QueryRoleRelListReqDto;
import com.wicket.okrframework.integration.FwBaseDivineDataClient;
import com.wicket.okrframework.integration.dto.BatchClearUserInfoFromRedisRespDto;
import com.wicket.okrframework.integration.dto.BatchClearUserInfoFromRedisReqDto;
import java.util.stream.Collectors;
import com.wicket.okrbff.common.exception.Assert;
import com.wicket.okrframework.integration.dto.QueryRoleDetailRespDto;
import com.wicket.okrframework.integration.dto.QueryRoleDetailReqDto;
import com.wicket.okrframework.integration.FwBaseInductionRecordClient;
import com.wicket.okrframework.integration.dto.QueryInductionRecordInfoDetailComRespDto;
import com.wicket.okrframework.integration.dto.QueryInductionRecordInfoDetailComReqDto;
import com.wicket.okrframework.integration.dto.QueryRoleListRespDto;
import com.wicket.okrframework.integration.dto.QueryRoleListReqDto;
import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrbff.common.util.CommonFunctionHelper;
import com.wicket.okrframework.integration.dto.ArchiveCustomRoleRespDto;
import com.wicket.okrframework.integration.dto.ArchiveCustomRoleReqDto;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Api(value = "Role", tags = {"Role"})
@RestController
// @RequestMapping("/oms/role/")
public class RoleController {

    @Autowired
    RoleService roleService;



    /**
   * B1-2查询角色详情（管理）
   * gen by moon at 8/10/2022, 3:35:40 AM
   */
    @PostMapping("/oms/mgt/role/queryRoleDetail")
    @ApiOperation(value = "B1-2查询角色详情（管理）", response = OkrResult.class)
    public OkrResult<BffQueryRoleDetailRespDto> queryRoleDetail(@RequestBody(required=false) @Validated BffQueryRoleDetailReqDto reqDTO){
        return OkrResult.success(roleService.queryRoleDetail(reqDTO));
    }

    /**
   * B1-2查询自定义角色列表（管理）
   * gen by moon at 8/10/2022, 3:35:37 AM
   */
    @PostMapping("/oms/mgt/role/queryCustomRoleList")
    @ApiOperation(value = "B1-2查询自定义角色列表（管理）", response = OkrResult.class)
    public OkrResult<BffQueryCustomRoleListRespDto> queryCustomRoleList(@RequestBody(required=false) @Validated BffQueryCustomRoleListReqDto reqDTO){
        return OkrResult.success(roleService.queryCustomRoleList(reqDTO));
    }

    /**
   * B1-2查询自定义角色详情（管理）
   * gen by moon at 8/10/2022, 3:32:03 AM
   */
    @PostMapping("/oms/mgt/role/queryCustomRoleDetail")
    @ApiOperation(value = "B1-2查询自定义角色详情（管理）", response = OkrResult.class)
    public OkrResult<BffQueryCustomRoleDetailRespDto> queryCustomRoleDetail(@RequestBody(required=false) @Validated BffQueryCustomRoleDetailReqDto reqDTO){
        return OkrResult.success(roleService.queryCustomRoleDetail(reqDTO));
    }

    /**
   * B1-2修改自定义角色（管理）
   * gen by moon at 8/10/2022, 3:29:42 AM
   */
    @PostMapping("/oms/mgt/role/updateCustomRole")
    @ApiOperation(value = "B1-2修改自定义角色（管理）", response = OkrResult.class)
    public OkrResult<BffUpdateCustomRoleRespDto> updateCustomRole(@RequestBody(required=false) @Validated BffUpdateCustomRoleReqDto reqDTO){
        return OkrResult.success(roleService.updateCustomRole(reqDTO));
    }



    /**
   * B1-2存档自定义角色（管理）
   * gen by moon at 8/10/2022, 3:37:15 AM
   */
    @PostMapping("/oms/mgt/role/archiveCustomRole")
    @ApiOperation(value = "B1-2存档自定义角色（管理）", response = OkrResult.class)
    public OkrResult<BffArchiveCustomRoleRespDto> archiveCustomRole(@RequestBody(required=false) @Validated BffArchiveCustomRoleReqDto reqDTO){
        return OkrResult.success(roleService.archiveCustomRole(reqDTO));
    }
}
